/*
 * 系统名称：
 * 模块名称：
 * 描述：
 * 作者：徐骏
 * version 1.0
 * time  2010-9-3 上午10:29:08
 * copyright Anymusic Ltd.
 */
package test;

import javax.swing.JFrame;

import com.mxgraph.swing.mxGraphComponent;
import com.mxgraph.view.mxGraph;

/**
 * @author 徐骏
 * @data 2010-9-3
 */
public class HelloWorld extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public HelloWorld() {
		mxGraph graph = new mxGraph();
		Object parent = graph.getDefaultParent();

		graph.getModel().beginUpdate();

		Object v1 = graph.insertVertex(parent, null, "客户端", 20, 20, 80, 30,
				"ROUNDED;strokeColor=red;opacity=20");
		Object v2 = graph.insertVertex(parent, null, "服务器", 240, 150, 80, 30);
		graph.insertEdge(parent, null, "网线", v1, v2);

		graph.getModel().endUpdate();

		mxGraphComponent graphComponent = new mxGraphComponent(graph);
		getContentPane().add(graphComponent);
	}

	public static void main(String[] args) {
		HelloWorld frame = new HelloWorld();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(400, 320);
		frame.setVisible(true);
	}

}
